package com.ruoyi.cms.controller.website;

import com.ruoyi.cms.domain.CmsLoopAction;
import com.ruoyi.cms.service.ICmsLoopActionService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 轮播广告Controller
 *
 * @author houyong
 * @date 2025-11-08
 */
@Tag(name = "CmsSiteLoopActionController", description = "轮播广告管理for web前端")
@RestController
@RequestMapping("cms/website/action")
public class CmsSiteLoopActionController extends BaseController {
    @Autowired
    private ICmsLoopActionService cmsLoopActionService;

    /**
     * 查询轮播广告列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CmsLoopAction cmsLoopAction) {
        startPage();
        List<CmsLoopAction> list = cmsLoopActionService.selectCmsLoopActionList(cmsLoopAction);
        return getDataTable(list);
    }


    /**
     * 获取轮播广告详细信息
     */
//    @RequiresPermissions("system:action:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(cmsLoopActionService.selectCmsLoopActionById(id));
    }


}
